<h1>Freight Invoice Document</h1>
<fieldset>
<legend> Information </legend>
<?php if($freightinvoice){
    $tempsession = $tempsession = $this->session->userdata('user');
    foreach($freightinvoice['freightinvoice'] as $rows){
        $location_file = $rows->LocationFile;
        $idfreightinvoice = $rows->idFreightInvoice;
?>
<form method="POST" action="<?php echo base_url();?>shippingline/updatepaymentfreightinvoice" enctype="multipart/form-data">
    <input type="hidden" name="idfreightinvoice" value="<?php echo $rows->idFreightInvoice;?>" />
<table>
    <tr>
        <td>Sender</td>
        <td><label><?php echo $rows->slname;?></label></td>
        <td>Replier</td>
        <td><label><?php echo $rows->cname;?></label></td>
    </tr>
    <tr>
        <td>Sent Date</td>
        <td><label><?php echo $rows->SentDate;?></label></td>
        <td>Replied Date</td>
        <td><label><?php echo $rows->RepplyDate;?></label></td>
    </tr>
    <tr>
        <td>Sent Status</td>
        <td><label><?php echo $rows->SentStatus;?></label></td>
        <td>Replied Status</td>
        <td><label><?php echo $rows->RepplyStatus;?></label></td>
    </tr>
    <tr>
        <td>Sent Message</td>
        <td><label><?php echo $rows->SentNote;?></label></td>
        <td>Replied Message</td>
        <td><?php echo $rows->RepplyNote;?></td>
    </tr>
    <tr>
        <td>Payment Status</td>
        <td><label><?php if($rows->PaymentStatus=='notpaid'){ ?> <select name="paymentstatus"><option value="paid">paid</option><option value="notpaid">notpaid</option></select> <?php } else{echo $rows->PaymentStatus;}?></label></td>
        <td>Payment Document</td>
        <td><?php if($rows->PaymentFile){echo "<label><a href='".base_url()."assets/documents/process/ShippingLine/".$tempsession['Username']."/Inbox/".$rows->PaymentFile."' target='_blank' >view</a></label>";} ?></td>
    </tr>
    <tr>
        <td></td>
        <td><?php if($rows->PaymentStatus=='notpaid'){ echo "<input type='submit' name='submit' value='submit' />";} ?></td>
        <td></td>
        <td></td>
    </tr>
</table>
</form>
</fieldset>
<br/>
<fieldset>
<legend> Content </legend>
<table>
    <tr>
        <td><label>Creation Date</label></td>
        <td><label><?php echo $rows->CreationDate;?></label></td>
        <td>No Bill of Lading</td>
        <td><label><?php echo $rows->FINumber;?></label></td>
    </tr>
    <tr>
        <td>Shipper</td>
        <td><label><?php echo $rows->SLName;?></label></td>
        <td>Consignee</td>
        <td><label><?php echo $rows->CName;?></label></td>
    </tr>
    <tr>
        <td></td>
        <td><label><?php echo $rows->SLAddress;?></label></td>
        <td></td>
        <td><label><?php echo $rows->CAddress;?></label></td>
    </tr>
    <tr>
        <td></td>
        <td><label><?php echo $rows->SLTelp;?></label></td>
        <td></td>
        <td><label><?php echo $rows->CTelp;?></label></td>
    </tr>
    <tr>
        <td>Notify Party</td>
        <td><label><?php echo $rows->NPName;?></label></td>
        <td>Forwarder</td>
        <td><label><?php echo $rows->FName;?></label></td>
    </tr>
    <tr>
        <td></td>
        <td><label><?php echo $rows->NPAddress;?></label></td>
        <td></td>
        <td><label><?php echo $rows->FAddress;?></label></td>
    </tr>
    <tr>
        <td></td>
        <td><label><?php echo $rows->NPTelp;?></label></td>
        <td></td>
        <td><label><?php echo $rows->FTelp;?></label></td>
    </tr>
    <tr>
        <td>Precarriage</td>
        <td><label><?php echo $rows->Precarriage;?></label></td>
        <td>Place of Receipt</td>
        <td><label><?php echo $rows->PlaceOfReceipt;?></label></td>
    </tr>
    <tr>
        <td>Vessel</td>
        <td><label><?php echo $rows->Vessel;?></label></td>
        <td>Port of Loading</td>
        <td><label><?php echo $rows->PortOfLoading;?></label></td>
    </tr>
    <tr>
        <td>Port of Discharge</td>
        <td><label><?php echo $rows->PortOfDischarge;?></label></td>
        <td>Place of Delivery</td>
        <td><label><?php echo $rows->PlaceOfDelivery;?></label></td>
    </tr>
    <tr>
        <td>Total Freight Prepaid</td>
        <td><label><?php echo $rows->TotalFreightPrepaid;?></label></td>
        <td>Total Freight Collect</td>
        <td><label><?php echo $rows->TotalFreightCollect;?></label></td>
    </tr>
    <tr>
        <td>Total Freight</td>
        <td><label><?php echo $rows->TotalFreight;?></label></td>
        <td></td>
        <td></td>
    </tr>
</table>
<br/>
<?php 
    }
?>
    <fieldset>
        <legend>Line Item</legend>
        <table>
            <tr>
                <td>Container No</td>
                <td>Seal No</td>
                <td>Package</td>
                <td>Description</td>
                <td>Weight</td>
                <td>Measurement</td>
                <td>Rate</td>
                <td>Charges</td>
            </tr>
            <?php foreach($freightinvoice['lineitem'] as $rows){ ?>
            <tr>
                <td><?php echo $rows->ContainerNo;?></td>
                <td><?php echo $rows->SealNo;?></td>
                <td><?php echo $rows->Package;?></td>
                <td><?php echo $rows->Description;?></td>
                <td><?php echo $rows->Weight;?></td>
                <td><?php echo $rows->Measurement;?></td>
                <td><?php echo $rows->Rate;?></td>
                <td><?php echo $rows->Charges;?></td>
            </tr>
            <?php }?>
        </table>
    </fieldset>
    <br/>
    <label><a href="<?php echo base_url();?>shippingline/downloaddocument/FI/<?php echo $idfreightinvoice;?>" target="_blank" >Download Document</a></label>
    
</fieldset>
<br/>
<?php
    }
?>